package br.ufpb.bioinfo.bean;

import java.util.List;

import br.ufpb.bioinfo.dao.DAOOrganism;
import br.ufpb.bioinfo.model.Organism;


public class SearchBean {

	private String mainQuery;
	private String organismName;
	private double higherTemperature;
	private double lowerTemperature;
	private double higherCGContent;
	private double lowerCGContent;
	private double higherRate;
	private double lowerRate;
	private List<Organism> organisms;
	
	public String getMainQuery() {
		return mainQuery;
	}

	public void setMainQuery(String mainQuery) {
		this.mainQuery = mainQuery;
	}

	public String getOrganismName() {
		return organismName;
	}

	public void setOrganismName(String organismName) {
		this.organismName = organismName;
	}
	
	public double getHigherTemperature() {
		return higherTemperature;
	}

	public void setHigherTemperature(double higherTemperature) {
		this.higherTemperature = higherTemperature;
	}

	public double getLowerTemperature() {
		return lowerTemperature;
	}

	public void setLowerTemperature(double lowerTemperature) {
		this.lowerTemperature = lowerTemperature;
	}

	public double getHigherCGContent() {
		return higherCGContent;
	}

	public void setHigherCGContent(double higherCGContent) {
		this.higherCGContent = higherCGContent;
	}

	public double getLowerCGContent() {
		return lowerCGContent;
	}

	public void setLowerCGContent(double lowerCGContent) {
		this.lowerCGContent = lowerCGContent;
	}

	public double getHigherRate() {
		return higherRate;
	}

	public void setHigherRate(double higherRate) {
		this.higherRate = higherRate;
	}

	public double getLowerRate() {
		return lowerRate;
	}

	public void setLowerRate(double lowerRate) {
		this.lowerRate = lowerRate;
	}
	
	public List<Organism> getOrganisms() {
		return organisms;
	}

	public void setOrganisms(List<Organism> organisms) {
		this.organisms = organisms;
	}

	public String search() {
		DAOOrganism dao = new DAOOrganism();
		organisms = dao.findByField("name", getMainQuery());
		return "success";
	}
	
	public String advancedSearch() {
		return null;
	}
	
}
